﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Windows.Data;
using Redboil.Bfp.Client.Views;
using Redboil.Bfp.Core;
using Redboil.Bfp.Service;
using Redboil.Bfp.Model;

namespace Redboil.Bfp.Client.ViewModels {
    public class AcceptViewModel {
        private CollectionView transportOrderList;
        private DelegateCommand selectCommand;
        private IView view;


        public CollectionView TransportOrderList {
            get {
                return transportOrderList;
            }
        }

        public DelegateCommand SelectCommand {
            get {
                return selectCommand;
            }
        }

        public AcceptViewModel() : this(null) {

        }

        public AcceptViewModel(IView view) {
            this.view = view;
            //this.transportOrderList = new CollectionView(Container.Instance.Resolve<ITransportService>()
            //    .GetAllTransportOrders());
            this.selectCommand = new DelegateCommand(this.SelectCommandHandler);

        }

        private void SelectCommandHandler(object sender, EventArgs e) {
            //TransportOrder transportOrder = this.transportOrderList.CurrentItem as TransportOrder;
            //UserSession.CurrentTransportOrder = transportOrder;
            this.view.Close();
        }
    }
}
